<html>
<head>
<title>Login Page</title>
</head>
<body onload='document.f.username.focus();'>
	<form name='f' action='/login' method='POST'>
	<fieldset>
		<legend>(Demo)Login with Username and Password</legend>
		<#--
		<!-- use param.error assuming FormLoginConfigurer#failureUrl contains the query parameter error --/>
        <c:if test="${param.error != null}">
            <div>
                Failed to login.
                <c:if test="${SPRING_SECURITY_LAST_EXCEPTION != null}">
                  Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
                </c:if>
            </div>
        </c:if>
        <!-- the configured LogoutConfigurer#logoutSuccessUrl is /login?logout and contains the query param logout --/>
        <c:if test="${param.logout != null}">
            <div>
                You have been logged out.
            </div>
        </c:if>
        -->
        <#if error??>
        	<p style='color:red;'>Your login attempt was not successful, try again.<br/><br/>Reason: ${error}</p>        	
        </#if>
		<input name="${_csrf.parameterName}" type="hidden"	value="${_csrf.token}" />
		<table>
			<tr>
				<td>User:</td>
				<td><input type='text' name='username'/></td>
			</tr>
			<tr>
				<td>Password:</td>
				<td><input type='password' name='password' /></td>
			</tr>
			<#--
			<tr>
				<td>Remember Me?</td>
				<td><input type="checkbox" id="remember-me" name="remember-me" /></td>
			</tr>
			-->
			<tr>
				<td colspan='2'><input name="submit" type="submit"	value="Login" /></td>
			</tr>
		</table>
	</fieldset>
</form>
</body>
</html>